#ifndef _LOG_H_
#define _LOG_H_

#include <iostream>
#include <ctime>
#include <string>
#define Debug 0
#define Notice 1
#define Warning 2
#define Error 3
static const std::string msg[] = {
    "Debug", "Notice", "Warning", "Error"};

std::ostream &Log(const std::string message, int level)
{
    //  // 获取当前时间并格式化
    // time_t now = time(nullptr);
    // char timestamp[20];
    // strftime(timestamp, sizeof(timestamp), "%Y-%m-%d %H:%M:%S", localtime(&now));

    std::cout << "|" << (unsigned)time(nullptr) << "|";
    std::cout << msg[level] << "|";
    std::cout << message;

    return std::cout;
}

#endif